<?php
class General_Http
{
	private static $instance = null;
	
	public static function getInstance()
	{
		if(self::$instance === null){
			self::$instance = new self() ;
		}
		return self::$instance;
	}
public function isXhr()
	{
		return isset($_SERVER['HTTP_X_REQUESTED_WITH']);
	}
	
	private function __construct()
	{
		
	}
	public function getParam($paramName, $deafultValue = null)
	{
		return isset($_REQUEST[$paramName]) ? $_REQUEST[$paramName] : $deafultValue;
	}
	
	public function getPost()
	{
		return $_POST;
	}
	
	public function isPost()
	{
		return !empty($_POST);
	}
	
	public function isGet()
	{
		return !empty($_GET);
	}
}
	